package com.wg.redis.service.serviceImpl;

import com.wg.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @Author WuGang
 * @Date 2021/10/15 20:21
 * @Version 1.0
 */
@Service
public class RedisServiceImpl implements RedisService {
//    注入依赖里面的类的对象  操作Redis的
    @Autowired
    private RedisTemplate<Object,Object> redisTemplate;
    @Override
    public void put(String key, String value) {
        redisTemplate.opsForValue().set(key,value);//value指的是Redis里面string这种类型
        System.out.println("成功");
    }
}
